﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data.SqlClient;
using Common;
using System.Data;

namespace Dao
{
    public  class PostStatisticData
    {
        public PostStatisticData() { }
        public double TotalPost()
        {
            SqlConnection conn = new SqlConnection(SQLDBHelper.CONN_STRING);
            SqlDataReader reader = SQLDBHelper.ExecuteReader(conn, CommandType.StoredProcedure, "sp_TotalPost", null);
            if (reader.Read())
            {
                return reader.GetInt32(0);
            }
            return 0;
        }

        public double TotalReply()
        { 
            SqlConnection conn = new SqlConnection(SQLDBHelper.CONN_STRING);
            SqlDataReader  reader = SQLDBHelper.ExecuteReader(conn, CommandType.StoredProcedure, "sp_TotalReply", null);
            if (reader.Read())
            {
                return reader.GetInt32(0);
            }
            return 0;
        }
    }
}
